<template>
    <div>
        千米 : <input type="text" v-model="kilometers">
        米 : <input type="text" v-model="meters">
    </div>
</template>

<script>
    export default {
        name: "watch",
        data() {
            return {
                kilometers: 0,
                meters: 0
            }
        },
        watch: {
            kilometers: function (val) {
                this.kilometers = val
                this.meters = this.kilometers * 1000
            },
            meters: function (val) {
                this.kilometers = val / 1000;
                this.meters = val
            }
        }
    }
</script>

<style scoped>

</style>
